package exam;

/**
 * Tests the answer to the second loop question.
 * The text of the question is as follows:
 * "Write an iterative method that returns a single String containing n copies of the parameter 
 *  String."
 * 
 * @author Branden Ogata
 *
 */

public class TestLoopA01 extends Tester
{
  public static void main(String[] args)
  {
    final double points = getPoints(args);
    
    LoopA01 question = new LoopA01();
    System.out.println(test(Category.EQUALS, "stringCopy(\"+\", -1):", "", 
                            question.stringCopy("*", -1), percentageToPoints(SIXTH, points)));
    System.out.println(test(Category.EQUALS, "stringCopy(\"*\", 0):", "", 
                            question.stringCopy("*", 0), percentageToPoints(SIXTH, points)));
    System.out.println(test(Category.EQUALS, "stringCopy(\"alpha\", 1):", "alpha", 
                            question.stringCopy("alpha", 1), percentageToPoints(SIXTH, points)));
    System.out.println(test(Category.EQUALS, "stringCopy(\"str\", 2):", "strstr", 
                            question.stringCopy("str", 2), percentageToPoints(SIXTH, points)));
    System.out.println(test(Category.EQUALS, "stringCopy(\"java\", 5):", "javajavajavajavajava", 
                            question.stringCopy("java", 5), percentageToPoints(SIXTH, points)));
    System.out.println(test(Category.EQUALS, "stringCopy(\"\", 7):", "", 
                            question.stringCopy("", 7), percentageToPoints(SIXTH, points)));
    
    System.out.format("[%.2f/%.2f]%n", getTotalPoints(), points);
  }
}
